{% extends 'base/front_base.html' %}
{% load news_filters %}
{% block title %}
	新闻搜索 - 小饭桌
{% endblock %}

{% block head %}
	<link rel="stylesheet" href="{% static 'css/news/search.min.css' %}">
{% endblock %}

{% block main %}
	<div class="main">
		<div class="wrapper">
			<div class="main-content-wrapper">
				<div class="search-group">
					<div class="search-box">
						<form action="" method="get">
							{% csrf_token %}
							<div class="input-area"><input type="text" name="q" placeholder="可输入新闻关键字、作者名字搜索" value={{ query }} ></div>
							<div class="submit_btn"><input type="submit" name="submit" value="搜索" ></div>
						</form>
					</div>
				</div>
				<div class="list-outer-group">
						<p class="list-title">热门推荐</p>
						<ul class="list-inner-group">
							{% for result in page.object_list %}
								{% with result.object as news %}
								<li>
									<div class="thumbnail-group">
										<a href="#">
											<img src="{{ news.thumbnail }}" alt="Alternate Text" />
										</a>
									</div>
									<div class="news-group">
										<p class="title">{{ news.title }}</p>
										<p class="desc">{{ news.desc }}</p>
										<p class="more">
											<span class="keywords">
												{{ news.category.name }}
											</span>
											<span class="pub-time">{{ news.pub_time|time_since }}</span>
											<span class="author">{{ news.author.name }}</span>
										</p>
									</div>
								</li>
							{% endwith %}
							{% endfor %}
						</ul>
				</div>
			</div>
			{% include 'common/sidebar.html' %}
		</div>
	</div>
{% endblock %}
